# -*- coding: utf-8 -*-
# @Time    : 2019/10/14 11:47
# @Author  : LiHaowen
# @Email   : lihaowen2017@163.com
# @File    : company.py


# class Company(object):
#     def __init__(self, employee_list):
#         self.employee = employee_list
#
#     def __getitem__(self, item):
#         # 变为可迭代类型
#         return self.employee[item]
#
#
# company = Company(["tom", "bob", "jane"])
#
# employee = company
# for em in company:
#     print(em)

class Company(object):
    def __init__(self, employee_list):
        self.employee = employee_list

    def __str__(self):
        # 字符串格式化
        return ",".join(self.employee)

    def __repr__(self):
        # 开发模式调用
        return ",".join(self.employee)

    def __len__(self):
        return len(self.employee)


company = Company(["tom", "bob", "jane"])

# print(company)
# print(company.__repr__())



